package com.simou.service;

import com.simou.dao.UserMapper;
import com.simou.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService{
    @Autowired
    UserMapper userMapper;

    @Override
    public User getUser(@Param("userCode") String userCode,@Param("userPassword") String userPassword) {
        return userMapper.getUser(userCode,userPassword);
    }

    @Override
    public List<User> getUsersByLimit(int start, int pageSize, Long queryUserRole, String queryName) {
        return userMapper.getUsersByLimit(start, pageSize, queryUserRole, queryName);
    }

    @Override
    public int getUsersCount(Long queryUserRole, String queryName) {
        return userMapper.getUsersCount(queryUserRole,queryName);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int updateUser(long uid, User user) {
        return userMapper.updateUser(uid,user);
    }

    @Override
    public int deleteUser(long uid) {
        return userMapper.deleteUser(uid);
    }

}
